<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var o = {
      name: 'zs',
      age: 18,
      dog: {
        name: 'littleYellow',
        firends: [{
          name: 'littleWhite'
        }, {
          name: 'littleBlack'
        }]
      }
    }

    var obj = {}

    Object.assign(obj, o)

    console.log(obj)
    console.log(obj === o) // false
    console.log(obj.dog === o.dog) // true

    obj.dog.name = 'bigYellow'
    console.log(o)
    console.log(obj)
  </script>
</body>

</html>